const idParseInt = async (ctx, next) => {
  const request = ctx.request
  if (request && request.query) {
    if (ctx.request.query.id) {
      ctx.request.query.id = +ctx.request.query.id
    }
  }
  await next()
}

module.exports = {
  idParseInt,
}
